package com.ibeetl.admin.console.service;

import com.ibeetl.admin.console.dao.DictConsoleDao;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.cms.dao.CmsCatalogDao;
import com.ibeetl.cms.dao.CmsCatalogDictDao;
import com.ibeetl.cms.entity.CmsCatalog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CatalogDictConsoleService extends CoreBaseService<CmsCatalog> {

    @Autowired
    CmsCatalogDao catalogDao;

    @Autowired
    DictConsoleDao dictDao;
    @Autowired
    CmsCatalogDictDao cmsCatalogDictDao;
    public List<Long> getDictIdByCatalog(Long catalogId) {
        List<Long> l = this.cmsCatalogDictDao.getDictIdByCatalog(catalogId);
        return l;
    }

    public List<CmsCatalog> getCatalogByDictTypeAndValue(String type, String value) {
        List<CmsCatalog> l = this.cmsCatalogDictDao.getCatalogByDictTypeAndValue(type, value, null);
        return l;
    }
    public List<CmsCatalog> getCatalogByDictTypeAndValue(String type, String value, Long parentCatalogId) {
        List<CmsCatalog> l = this.cmsCatalogDictDao.getCatalogByDictTypeAndValue(type, value, parentCatalogId);
        return l;
    }
}
